package cn.iocoder.yudao.module.product.favorite.api;

import cn.iocoder.yudao.module.api.product.favorite.ProductFavoriteApi;
import cn.iocoder.yudao.module.product.favorite.service.AppProductFavoriteService;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2024/04/09
 */
@Service
@Validated
public class ProductFavoriteApiImpl implements ProductFavoriteApi {
    @Resource
    @Lazy // 延迟加载，避免循环依赖
    private AppProductFavoriteService productFavoriteService;

    @Override
    public Integer getFavoriteCount(Long userId) {
        return productFavoriteService.getCount(userId);
    }

}
